﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Hospitals/Master/HospitalsMaster.Master"
    AutoEventWireup="true" CodeBehind="PurchaseOrderCheck.aspx.cs" Inherits="HZ.DrugTrade.Web.Hospitals.Procurement.PurchaseOrderCheck" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabnav">
        <ul>
            <li><a href="PurchaseOrderUnCheck.aspx">未提交</a></li>
            <li class="active"><a href="PurchaseOrderCheck.aspx">已提交</a></li>
        </ul>
    </div>
    <div id="tabcontent">
        <table class="querylist">
            <tr>
                <td>
                    <table class="querylist">
                        <tr>
                            <td align="right">
                                <asp:Label ID="lblOrderName" runat="server" Text="采购单名称："></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtOrderName" runat="server"></asp:TextBox>
                            </td>
                            <td align="right">
                                &nbsp;
                            </td>
                            <td align="left">
                                &nbsp;
                            </td>
                        </tr>
                        <asp:Literal ID="ltlAdvance" runat="server" Text="&lt;tbody id='advance' style='display:none'&gt;"></asp:Literal>
                        <tr>
                            <td align="right">
                                <asp:Label ID="lblPlanTime" runat="server" Text="制单时间："></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtPlanTimeFrom" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                                -
                                <asp:TextBox ID="txtPlanTimeTo" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:Label ID="lblAccount" runat="server" Text="采购单总额："></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtAccountFrom" runat="server" Width="62px" oncontextmenu="javascript:return false;"
                                    onblur="javascript:return check_isdecimal();" onkeydown="javascript:return check_isdecimal();"
                                    ToolTip="请输入数字"></asp:TextBox>
                                -
                                <asp:TextBox ID="txtAccountTo" runat="server" Width="62px" oncontextmenu="javascript:return false;"
                                    onblur="javascript:return check_isdecimal();" onkeydown="javascript:return check_isdecimal();"
                                    ToolTip="请输入数字"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="lblStartTime" runat="server" Text="开始时间："></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtStartTimeFrom" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                                -
                                <asp:TextBox ID="txtStartTimeTo" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                            </td>
                            <%--<td align="right">
                                <asp:Label ID="lblEndTime" runat="server" Text="结束时间："></asp:Label>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtEndTimeFrom" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                                
                                <asp:TextBox ID="txtEndTimeTo" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                    Width="62px"></asp:TextBox>
                            </td>--%>
                        </tr>
                    </table>
                </td>
                <td>
                    <hz:HzButton ID="btnButton" runat="server" Text="查 询" OnClick="btnButton_Click" CssClass="btn" />
                    <hz:HzLinkButton ID="lbnSwitch" runat="server" CommandArgument="simple" Text="高级查询"
                        OnClick="lbnSwitch_Click"></hz:HzLinkButton>
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="gvwPurchaseOrder" runat="server" AutoGenerateColumns="False" EmptyDataText="暂无符合条件的数据!"
        DataKeyNames="OrderID,HospitalID" Width="100%" OnRowCancelingEdit="gvwPurchaseOrder_RowCancelingEdit"
        OnRowEditing="gvwPurchaseOrder_RowEditing" OnRowUpdating="gvwPurchaseOrder_RowUpdating"
        OnRowDataBound="gvwPurchaseOrder_RowDataBound" 
        onrowcommand="gvwPurchaseOrder_RowCommand">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%#Container.DataItemIndex + 1 + AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex-1) %></ItemTemplate>
                <HeaderStyle Width="30px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="采购单名称">
                <ItemTemplate>
                    <a href='PurchaseOrderUpdate.aspx?orderID=<%# Eval("OrderID") %>'>
                        <asp:Label runat="server" ID="lblOrderName" Text='<%#(DataBinder.Eval(Container,"DataItem.OrderName")) %>'
                            ToolTip="点击进入查看采购单详细信息"></asp:Label></a>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtOrderName" runat="server" Text='<%#(DataBinder.Eval(Container,"DataItem.OrderName")) %>'
                        Enabled='<%# ((int)Eval("OrderStatus")==1)?false:true %>' ToolTip='<%# ((int)Eval("OrderStatus")==1)?"已提交的采购单不能修改采购单名称":"" %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="开始时间">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblStartTime" Text='<%#(DataBinder.Eval(Container,"DataItem.StartTime","{0:yyyy-MM-dd}")) %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtStartTime" runat="server" Text='<%#(DataBinder.Eval(Container,"DataItem.StartTime","{0:yyyy-MM-dd}")) %>'
                        MaxLength="10" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" Width="62px" Enabled='<%# ((int)Eval("OrderStatus")==1)?false:true %>'
                        ToolTip='<%# ((int)Eval("OrderStatus")==1)?"已提交的采购单不能修改开始采购时间":"" %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <%--<asp:TemplateField HeaderText="结束时间">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblPlanEndTime" Text='<%#(DataBinder.Eval(Container,"DataItem.PlanEndTime","{0:yyyy-MM-dd}")) %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtPlanEndTime" runat="server" Text='<%#(DataBinder.Eval(Container,"DataItem.PlanEndTime","{0:yyyy-MM-dd}")) %>'
                        MaxLength="10" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" Width="62px"></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>--%>
            <asp:TemplateField HeaderText="采购单状态">
                <ItemTemplate>
                    <asp:Label ID="lblOrderStatus" runat="server" Text='<%# Eval("OrderStatus") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Width="70px" />
            </asp:TemplateField>
            <asp:BoundField DataField="TotalAmount" HeaderText="采购单总额" ReadOnly="true" HeaderStyle-Width="70" />
            <asp:BoundField DataField="PlanTime" DataFormatString="{0:d}" HeaderText="制定时间" ReadOnly="true" />
            <asp:BoundField DataField="PlanPerson" HeaderText="制定人" ReadOnly="true" />
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <hz:HzLinkButton ID="lbnMod" runat="server" Text="修改"  Visible="false" CommandName="Edit" ToolTip="修改采购单名称和采购时间" />
                    <hz:HzLinkButton ID="lbnCopy" runat="server" OnClientClick='<%# GetURLScript("PurchaseOrderCopy.aspx?orderID="+Eval("OrderID"))%>' Text="复制" ToolTip="复制采购单"></hz:HzLinkButton>
                    <hz:HzLinkButton ID="lbnRecall" runat="server" Text="撤回" OnClientClick="return confirm('确定要撤回这个采购单及所有相关明细吗?')" CommandName="Recall" CommandArgument='<%# Eval("OrderID") %>'></hz:HzLinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <hz:HzLinkButton ID="lbnUpdate" CssClass="innerbtn" runat="server" CausesValidation="True"
                        CommandName="Update" Text="更新" ToolTip="保存修改信息" /><hz:HzLinkButton ID="lbnCancel"
                            CssClass="innerbtn" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="取消" ToolTip="取消操作" /></EditItemTemplate>
                <ItemStyle Width="80px" />
            </asp:TemplateField>
            <%--            <asp:TemplateField>
                <HeaderTemplate>
                    <input id="addTable_chkAll" name="chkAll" type="checkbox" onclick="SelectAllCheckboxes(this,'ctl00_ContentPlaceHolder1_gvwPurchaseOrder','addTable_chkAll'); " />
                </HeaderTemplate>
                <ItemTemplate>
                    <input type="checkbox" name="checkbox1" id="checkbox1" value='<%#Eval("OrderID")%>'
                        onclick="chkChecked(this,'ctl00_ContentPlaceHolder1_gvwPurchaseOrder','addTable_chkAll');"
                        runat="server" />
                </ItemTemplate>
                <HeaderStyle Width="25px" />
            </asp:TemplateField>--%>
        </Columns>
    </asp:GridView>
     <div class="page">
    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_OnPageChanged">
    </webdiyer:AspNetPager>
    </div>
    <div class="listip">
        <ul>
            <li>说明：<span>点击修改可以修改采购单的基本信息；点击采购单名称可以进入相应的采购单查看采购明细。</span></li>
        </ul>
    </div>
    <%--    <div class="listctrl">
        <hz:HzButton runat="server" ID="btnDel" Text="删除采购单" OnClientClick="return confrim(确定要删除所选采购单？)"
            CssClass="btn" />
    </div>--%>
</asp:Content>
